﻿using System;
using System.Collections.Generic;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;

public partial class manage_djList : AdminpageBase
{
    protected List<Model.LotteryBuyDetail> lottery = null;
    protected int type = 0;
    protected void Page_Load(object sender, EventArgs e)
    {
        if (!IsPostBack)
        {
            inidata();
        }
    }
    private void inidata()
    {
        int totalcount = 0;
        lottery = BLL.LotteryBuyDetail.GetIsWin(this.AspNetPager1.CurrentPageIndex - 1, this.AspNetPager1.PageSize, 0, out totalcount);

        PagedDataSource pds = new PagedDataSource();
        if (lottery != null && lottery.Count > 0)
        {

            AspNetPager1.RecordCount = totalcount;
            pds.AllowPaging = true;
            pds.PageSize = AspNetPager1.PageSize;
            pds.CurrentPageIndex = AspNetPager1.CurrentPageIndex - 1;

        }
    }
    protected void AspNetPager1_PageChanged(object sender, EventArgs e)
    {
        inidata();
    }
    protected void caipiaoType_SelectedIndexChanged(object sender, EventArgs e)
    {
        int totalcount = 0;
        type = int.Parse(caipiaoType.SelectedValue.ToString());
        lottery = BLL.LotteryBuyDetail.GetIsWin(0, this.AspNetPager1.PageSize, int.Parse(caipiaoType.SelectedValue.ToString()), out totalcount);
        PagedDataSource pds = new PagedDataSource();
        if (lottery != null && lottery.Count > 0)
        { 
            AspNetPager1.RecordCount = totalcount;
            pds.AllowPaging = true;
            pds.PageSize = AspNetPager1.PageSize;
            pds.CurrentPageIndex = AspNetPager1.CurrentPageIndex - 1;

        }
    }
}